<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('全局配置')"/>
    <link rel="stylesheet" th:href="@{/static/component/highlight/styles/vs.css}">
    <script th:src="@{/static/component/highlight/highlight.pack.js}"></script>
    <style type="text/css">
        div.code {
            white-space: pre;
        }
    </style>
</head>
<body class="pear-container">

<div class="user-main">

    <div class="layui-card">
        <div class="layui-tab layui-tab-brief" lay-filter="test1">
            <ul class="layui-tab-title">
                <li th:each="mapEntry,userStat: ${viewmap}" th:lay-id="${userStat.index}" th:text="${mapEntry.key}">
                    用户管理
                </li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item" th:each="mapEntry: ${viewmap}">
						<pre>
							<code class="language-java" th:if="${mapEntry.key.indexOf('.java')!=-1}"
                                  th:text="${mapEntry.value}">
							</code>
							<code class="language-sql" th:if="${mapEntry.key.indexOf('.sql')!=-1}"
                                  th:text="${mapEntry.value}">
							</code>
							<code class="language-html" th:if="${mapEntry.key.indexOf('.html')!=-1}"
                                  th:text="${mapEntry.value}">
							</code>
							<code class="language-xml" th:if="${mapEntry.key.indexOf('.xml')!=-1}"
                                  th:text="${mapEntry.value}">
							</code>
						</pre>
                </div>
            </div>
        </div>
    </div>
</div>
</body>


<th:block th:include="include :: footer"/>
<script>
    document.addEventListener('DOMContentLoaded', (event) => {
        document.querySelectorAll('pre code').forEach((block) => {
            hljs.highlightBlock(block);
        });
    });
    layui.use(['element', 'jquery'], function () {
        var element = layui.element;
        element.tabChange('test1', "0"); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项

    })
</script>
</html>